/**
* Copyright (c) 2016-2100 yunclouds
*/
package com.yunqian.web;

import com.yunqian.redot.domain.InformationType;
import com.yunqian.redot.service.InformationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * Describe: 咨询分类管理控制器
 *
 * @author zsy
 * 2018-09-29 15:54:40
 */
 @RestController
 @RequestMapping("/api/informationType")
public class InformationTypeController {

     @Autowired
     private InformationTypeService informationTypeService;

     /**
     * 获取显示分类列表
     *
     * @return
     */
    @GetMapping("/all")
    public Map<String, Object> list() {
        List<InformationType> informationTypeList = informationTypeService.getAllByStatusOrderBySortNum();
        for(int i=0;i<informationTypeList.size();i++){
            informationTypeList.get(i).setAppletUrl("http://www.wx-red-dot.cn/newsList.html#slider" + i);
        }
        Map<String, Object> map = new HashMap<>(16);
        map.put("informationTypeList", informationTypeList);
        return map;
    }


}
